<html	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:jsp="http://java.sun.com/JSP/Page"
		xmlns:f="http://java.sun.com/jsf/core"      
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:c="http://java.sun.com/jsp/jstl/core"
		xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"	>
      
    <h:head>
        <title>Modifier film</title>
		<link rel="stylesheet" href="../styles/style.css" />
    </h:head>
	
    <h:body>
    	<h:panelGroup rendered="#{loginBean.loginSucces}">
	    <ui:include src="../includes/header.xhtml" />
    	<ui:include src="../includes/menu.xhtml" />
    	
    	<div id="content">
    	<div id="modifFilm" >
    	<fieldset>
    	<legend><h:outputText value="Modification de #{modifierFilmBean.selectedFilm.titre}" /></legend>
		<h:form>
			<table>
				<tr>
					<td><h:outputText value="titre " /></td>
					<td><h:inputText id="titre" value="#{modifierFilmBean.selectedFilm.titre}" /></td>
				</tr>
				<tr>
					<td><h:outputText value="synopsis " /></td>
					<td><h:inputTextarea cols="50" rows="10" id="synopsis" value="#{modifierFilmBean.selectedFilm.synopsis}" /></td>
				</tr>
				<tr>
					<td><h:outputText value="date de sortie " /></td>
					<td>
						<!--h:inputText value="#{modifierFilmBean.selectedFilm.dateSortie}" /-->
						<h:inputText id="dateSortie" value="#{modifierFilmBean.selectedFilm.dateSortie}">
							<f:convertDateTime type="date" pattern="yyyy/MM/dd" />
						</h:inputText>
					</td>
				</tr>
				<tr>
					<td><h:outputText value="durée " /></td>
					<td><h:inputText id="duree" converter="javax.faces.Integer" value="#{modifierFilmBean.selectedFilm.duree}" /></td>
				</tr>
				<tr>
					<td><h:outputText value="réalisateur " /></td>
					<td><h:inputText id="realisateur" value="#{modifierFilmBean.selectedFilm.realisateur}" /></td>
				</tr>
				<tr>
					<td><h:outputText value="acteurs " /></td>
					<td><h:inputText id="acteurs" value="#{modifierFilmBean.selectedFilm.acteurs}" /></td>
				</tr>
				<tr>
					<td><h:outputText value="genre " /></td>
					<td>
						<h:selectOneMenu id="genre" value="#{modifierFilmBean.selectedFilm.genre}">
						  <f:selectItems value="#{modifierFilmBean.genresList}"  />
						</h:selectOneMenu>
					</td>
				</tr>
				<tr>
					<td><h:outputText value="rating " /></td>
					<td>
					<h:inputText id="rating" value="#{modifierFilmBean.selectedFilm.rating}">
						<f:convertNumber pattern="#0.0" maxFractionDigits="1" maxIntegerDigits="1" />
					</h:inputText>
					</td>
				</tr>
				<tr>
					<td><h:commandButton value="Valider" 
						action="#{modifierFilmBean.valideModification}"/>
					</td>
					<td>
						<h:message for="dateSortie" style="color:red" />
						<h:message for="duree" style="color:red" />
						<h:message for="genre" style="color:red" />
						<h:message for="rating" style="color:red" />
					</td>				
				</tr>
			</table>
		</h:form>
		</fieldset>
		</div>
		</div>
		<ui:include src="../includes/footer.xhtml" />
		
    	</h:panelGroup>
    	
    	<h:panelGroup rendered="#{!loginBean.loginSucces}">
			<ui:include src="../includes/authError.xhtml" />	
    	</h:panelGroup>
    </h:body>
</html>